<?php
#---------File Include
include_once 'conf/db-config.php';
error_reporting(0);
class clsAdmissionConsulting
{
	/*
	 * The Following function gives the package information for an particular user
	 * input : userid
	 * output: array of package
	 */
	public function getPackageDetailsForUser($userId)
	{
		$arrUserAdmissionPackge = array();
		$sql = "SELECT package FROM tbl_user_admission_package where user_id=".$userId." AND is_active='Y'";
		
		$run = mysql_query($sql);
		
		while ($data = mysql_fetch_array($run))
		{
			if(strlen($data['package'])==1)
			array_push($arrUserAdmissionPackge,$data['package']);
		}
		
		return $arrUserAdmissionPackge;
	}
	
	public function getAllIdNames()
	{
		$arrUserIdNames = array();
		$sql = "SELECT a.package, a.user_id, b.user_name FROM tbl_user_admission_package a , user_detail b WHERE a.user_id=b.id AND a.is_active='Y'";
		$run = mysql_query($sql);
		$count=0;
		while ($data = mysql_fetch_array($run))
		{
			if(strlen($data['package'])==1)
			{
				$arrUserIdNames[$count]['user_id'] = $data['user_id'];
				$arrUserIdNames[$count]['user_name'] = $data['user_name'];
			}
			$count++;
		}
		
		return $arrUserIdNames;
	}
}